package com.onlyyou.time.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author: 小野
 * @Date: 2020/1/11 9:30
 * 时间访问接口
 */
@RestController
@RequestMapping("/")
public class TimeController {
    @GetMapping("/getTime")
    public String getTime(){
        SimpleDateFormat simpleDateFormat= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return simpleDateFormat.format(new Date());
    }
}
